package com.etc.test1;

import java.util.List;

import com.xju.entity.Movie;
import com.xju.entity.Users;
import com.xju.tools.DBTools;
import com.xju.tools.PageData;

/**
 * 
 * @author admin
 *
 */
public class TestQueryUserByPage {

	public static void main(String[] args) {

		String sql = "select * from tbl_user";
		// Object exQuery(String sql, Class cls, Object... params)
		int page = 2;
		int pageSize = 2;
		PageData<Users> pd = (PageData<Users>) DBTools.exQueryByPage(sql, 
				Users.class, page, pageSize);

		System.out.println("getTotalCount(): " + pd.getTotalCount());
		System.out.println("getTotalPage() : " + pd.getTotalPage());
		for (Users user : pd.getData()) {
			System.out.println(user);
		}

	}

}
